<%--
  Created by IntelliJ IDEA.
  User: troy-kou
  Date: 13-12-11
  Time: 下午4:42
  Email:kouhongyu@163.com
--%>
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="mis" uri="/lvmama-tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/style/houtai.css"/>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>js/op/groupBudget/component/My97DatePicker/skin/default/datepicker.css"/>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>js/op/groupBudget/component/My97DatePicker/skin/WdatePicker.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/themes/base/jquery.ui.all.css"/>

    <script type="text/javascript" src="<%=request.getContextPath()%>/js/base/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/ui/jquery-ui-1.8.5.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/op/groupBudget/component/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/op/groupBudget/component/My97DatePicker/lang/en.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/base/dialog.js"></script>

    <script type="text/javascript">
        var basePath = "<%=basePath%>";
    </script>

    <script type="text/javascript">
        function showTaskJobLogInfo(taskJobLogId) {
            parent.showTaskJobLogInfo(taskJobLogId);

        }
        function queryTaskJobLogSubmit() {
            var taskJobLogId = $.trim($("#taskJobLogId").val());

            if (taskJobLogId != "") {
                var type = "^[0-9]*[1-9][0-9]*$";
                var re = new RegExp(type);
                if (taskJobLogId.match(re) == null) {
                    alert("“日志ID”应为正整数!");
                    $("#taskJobLogId").val("");
                    $("#taskJobLogId").focus();
                    return false;
                }
            }

            return true;
        }
        function sortQuery(sort, sortField) {
            $("#sort").val(sort);
            $("#sortField").val(sortField);
            $("#query_form").submit();
        }
    </script>
</head>

<body>
<div class="main main02" style="width: 98%">
    <div class="row1">
        <form id="query_form" action="<%=basePath%>pub/toTaskJobLogList.do" method="post">
            <s:hidden name="taskId"/>
            <s:hidden name="sort"/>
            <s:hidden name="sortField"/>
            <table border="0" cellspacing="0" cellpadding="0" class="newInput" width="100%">
                <tr>

                    <td><em>状态：</em></td>
                    <td>
                        <s:select list="@com.lvmama.comm.pet.po.pub.TaskResult$RUN_STATUS@values()"
                                  listKey="code" listValue="cnName"
                                  headerKey="" headerValue="选择"
                                  name="resultRunStatus" value="resultRunStatus"
                                  cssStyle="width: 134px;"/>
                    </td>
                    <td><em>时间：</em></td>
                    <td>
                        <input type="text"
                               class="Wdate"
                               style="width: 140px"
                               onclick="WdatePicker({isShowClear:true,readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                               name="startTime"
                               id="startTime"
                               value="<s:property value="startTime"/>"/>
                        ~
                        <input type="text"
                               class="Wdate"
                               style="width: 140px"
                               onclick="WdatePicker({isShowClear:true,readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                               name="endTime"
                               id="endTime"
                               value="<s:property value="endTime"/>"/>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td><em>耗时：</em></td>
                    <td>
                        <s:select list="@com.lvmama.task.common.utils.Constant$TIME_CONSUMING_MILLIS@values()"
                                  listKey="code" listValue="cnName"
                                  headerKey="" headerValue="选择"
                                  name="minTimeConsuming" value="minTimeConsuming"
                                  cssStyle="width: 60px;"/>
                          ~
                        <s:select list="@com.lvmama.task.common.utils.Constant$TIME_CONSUMING_MILLIS@values()"
                                  listKey="code" listValue="cnName"
                                  headerKey="" headerValue="选择"
                                  name="maxTimeConsuming" value="maxTimeConsuming"
                                  cssStyle="width: 60px;"/>
                    </td>
                    <td><em>ID：</em></td>
                    <td><s:textfield cssClass="newtext1" id="taskJobLogId" name="taskJobLogId" cssStyle="width: 290px;"/></td>
                    <td style="text-align: right;">
                        <input type="hidden" name="perPageRecord" value="<s:property value="pagination.perPageRecord"/>"/>
                        <input type="submit" class="button" value="查 询"/>
                    </td>
                </tr>
            </table>
        </form>
    </div>

    <div class="row2">
        <table border="0" cellspacing="0" cellpadding="0" class="newTable" style="text-align: center;">
            <tr class="newTableTit">
                <td>ID</td>
                <td>任务名称</td>
                <td>状态</td>
                <td>
                    <a href="javascript:void(0);" style="font-size: 14px;"
                            <s:if test="sort == 'ASC'">
                                onclick="sortQuery('DESC','startTime')"
                            </s:if>
                            <s:elseif test="sort == 'DESC'">
                                onclick="sortQuery('ASC','startTime')"
                            </s:elseif>
                            <s:else>
                                onclick="sortQuery('ASC','startTime')"
                            </s:else>
                    >
                        开始时间
                    </a>
                </td>
                <td>
                    <a href="javascript:void(0);" style="font-size: 14px;"
                            <s:if test="sort == 'ASC'">
                                onclick="sortQuery('DESC','endTime')"
                            </s:if>
                            <s:elseif test="sort == 'DESC'">
                                onclick="sortQuery('ASC','endTime')"
                            </s:elseif>
                            <s:else>
                                onclick="sortQuery('ASC','endTime')"
                            </s:else>
                    >
                        结束时间
                    </a>
                </td>
                <td>
                    <a href="javascript:void(0);" style="font-size: 14px;"
                            <s:if test="sort == 'DESC'">
                                onclick="sortQuery('ASC','timeConsuming')"
                            </s:if>
                            <s:elseif test="sort == 'ASC'">
                                onclick="sortQuery('DESC','timeConsuming')"
                            </s:elseif>
                            <s:else>
                                onclick="sortQuery('DESC','timeConsuming')"
                            </s:else>
                    >
                        耗时
                    </a>
                </td>
                <td></td>
            </tr>

            <s:iterator value="taskJobLogList">
                <tr>

                    <td><s:property value="taskJobLogId"/></td>
                    <td style="text-align: left;padding-left: 10px;"><s:property value="taskName"/></td>
                    <td>
                        <s:if test="resultRunStatus != null">
                            <s:property value="resultRunStatus.getCnName()"/>
                        </s:if>
                    </td>
                    <td>
                        <s:date name="startTime" format="yyyy-MM-dd HH:mm:ss"/>
                    </td>
                    <td>
                        <s:date name="endTime" format="yyyy-MM-dd HH:mm:ss"/>
                    </td>
                    <td style="text-align: right;padding-right: 15px;">
                        <s:property value="timeConsumingFormat"/>
                    </td>
                    <td>
                        <a href="javascript:void(0);" onclick="showTaskJobLogInfo('<s:property value="taskJobLogId"/>')">查看</a>
                    </td>
                </tr>
            </s:iterator>
        </table>
    </div>
    <table width="700" border="0" align="center">
        <s:include value="/WEB-INF/pages/back/base/pag.jsp"/>
    </table>

</div>

</body>
</html>


